<template>
  <el-dialog title="评价内容" :close-on-click-modal="false" :visible.sync="visible" center fullscreen append-to-body>
    <el-button class="miui-dialog-close-btn" @click="visible = false">关闭页面</el-button>
    <el-form size="medium" label-width="160px">
      <el-form-item label="前言">
        {{dataForm.evaluationTemplate.preface}}
      </el-form-item>

      <!-- <div v-for="(item,index) in dataForm.answerLogs" :key="index" style="margin-bottom: 5px;">
        <el-form-item :label="'问题' + (index + 1)">
          {{item.problemName}}
          <el-rate v-model="item.level" disabled :allow-half="true"></el-rate>
          {{item.answer}}
        </el-form-item>
      </div> -->

      <el-table :data="dataForm.answerLogs" border style="margin: 15px 0;">
        <el-table-column prop="problemName" label="问题"></el-table-column>
        <el-table-column prop="level" label="评分" width="50"></el-table-column>
        <el-table-column prop="answer" label="留言"></el-table-column>
      </el-table>

      <el-form-item label="结束语">
        {{dataForm.evaluationTemplate.concludingRemarks}}
      </el-form-item>
    </el-form>
  </el-dialog>
</template>

<script>
  import { remote } from '@/api/admin/dict'
  import { getAssessData } from '@/api/mp/wxevaluationlog'
  import { getQuestionTypeList } from '@/api/mp/wxevaluatetype'
  import { getWxEvaluationTemplateObj, addWxEvaluationTemplateObj, putWxEvaluationTemplateObj } from '@/api/mp/wxevaluationtemplate'
  export default {
    data() {
      return {
        visible: false,
        listVisible: false,
        typeVisible: false,
        ischeck: false,
        questionTypeList: [],
        dataForm: {
          id: '',
          typeWord: '',
          preface: '',
          problemList: [],
          concludingRemarks: '',
          rewardWay: 0,
          integral: '',
          status: 1
        }
      }
    },
    methods: {
      init(id) {
        this.visible = true
        this.dataForm.id = id
        if(this.dataForm.id){
          this.getData()
        }
      },
      getData(){
        getAssessData(this.dataForm.id).then(response => {
          this.dataForm = response.data.data
        })
      },

    }
  }
</script>

<style>
  table {
    width: 100%;
  }

  tr td {
    border: solid 1px #e7e7e7;
  }
</style>
